<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>v-model 结合下拉列表的使用</title>
</head>
<body>
<div id="app">
    <div>请选择你的最爱</div>
    <label>
        <select name="fruits" multiple v-model="fruits">
            <option value="apple">苹果</option>
            <option value="peach">桃子</option>
            <option value="banana">香蕉</option>
            <option value="orange">橘子</option>
            <option value="mongo">芒果</option>
            <option value="watermelon">西瓜</option>
        </select>
    </label>

    <h2>你最爱的水果是：<span>{{ fruits }}</span></h2>
</div>

<script type="module">
    import {createApp, ref} from "../../../js/vue.esm-browser.js";

    let app = createApp(
        {
            setup() {
                let fruits = ref([])
                return {fruits}
            }
        }
    );

    app.mount("#app")
</script>
</body>
</html>